import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../Layout.vue'
const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      alias: '/layout',
      children:[
        {
          path: 'home',
          name: 'home',
          component: () => import('../views/Layout/HomeView.vue')
        },
        {
          path: 'search',
          name: 'search',
          component: () => import('../views/Layout/SearchView.vue')
        },
        {
          path: 'server',
          name: 'server',
          component: () => import('../views/Layout/ServerView.vue')
        },
        {
          path: 'add',
          name: 'add',
          component: () => import('../views/Layout/AddView.vue')
        },
        {
          path: 'setting',
          name: 'setting',
          component: () => import('../views/Layout/SettingView.vue')
        },
      ]
    },
    
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/RegistView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/cover',
      name: 'cover',
      component: () => import('../views/CoverView.vue')
    },
    {
      path: '/detail',
      name: 'detail',
      component: () => import('../views/DetailView.vue')
    },
    {
      path: '/expand',
      name: 'expand',
      component: () => import('../views/ExpandView.vue')
    },
  ]
})

export default router
